package com.shermanzhou.aop;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author zhouchaoqun
 * @date 2018/9/10 下午2:04
 */
public class Main {

    public static void main(String[] args) throws InterruptedException {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext("com.shermanzhou.aop");
        HelloService helloService = ctx.getBean(HelloServiceImpl.class);

//        HelloService helloService = (HelloService) ctx.getBean("helloServiceImpl");
//        HelloService helloService2 = (HelloService) ctx.getBean("helloServiceImpl2");
        helloService.sayHello("Mike");
        System.out.println("main...");
        Thread.sleep(60000);
//        helloService2.sayHello("JACK");

//        AspectJProxyFactory factory = new AspectJProxyFactory(new HelloServiceImpl());
//
//        factory.addAspect(CheckingIllegalCharacterAspect.class);
//
//        HelloService proxy = factory.getProxy();
//        proxy.sayHello("MK");
    }
}
